<?php
	session_start();
	include_once("./stdlib.php");
	include_once("./config.php");
	include_once("./Servicios/Util/Conexion.php");
	include_once("./Servicios/Util/Propiedad.php");
	include_once("./Servicios/Util/Fecha.php");
	include_once("./Servicios/Util/Hora.php");
	include_once("./Servicios/Util/Foto.php");
	include_once("./Servicios/Persona/Direccion.php");
	include_once("./Servicios/Persona/Telefono.php");
	include_once("./Servicios/Persona/Persona.php");	
	include_once("./Servicios/Sucursales/Sucursal.php");
	include_once("./Servicios/Usuarios/Usuario.php");
	include_once("./Servicios/Usuarios/Session.php");
	include_once("./Servicios/Persona/Email.php");
	
	$sesion=new Session();	
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Enlace Admin</title>
<link rel="stylesheet" type="text/css" href="ext3/resources/css/ext-all.css" />
<link rel="stylesheet" id="theme" type="text/css" href="<?php echo $sesion->getTema();?>">

    <?php if(DESARROLLO){?>
<link rel="stylesheet" type="text/css" href="css/index.css" />

    <?php } else {?>
<link rel="stylesheet" type="text/css" href="css/jindex.css" />


    <?php }if(DESARROLLO){?>
    <script type="text/javascript" src="ext3/adapter/ext/ext-base.js"></script>
    <!-- ENDLIBS -->

    <script type="text/javascript" src="ext3/ext-all-debug.js"></script>
  	<!--script type="text/javascript" src="ext3/ext-all-debug.js"></script--> 
  	<script type="text/javascript" src="ext3/ext-lang-es.js"></script>

    <script type="text/javascript" src="js/Extmx/Extmx.js"></script>

    <script type="text/javascript" src="js/Extmx/grid/GridPanel.js"></script>
    <script type="text/javascript" src="js/Extmx/ModalWindow.js"></script>
    <script type="text/javascript" src="js/Extmx/WindowForm.js"></script>
    <script type="text/javascript" src="js/Extmx/FormPanel.js"></script>

<!-- UTIL-->
<!--script type="text/javascript" src="enlace.js"></script-->

<!-- UTIL-->
<script type="text/javascript" src="js/form/Vtypes.js"></script>
<script type="text/javascript" src="js/util/md5.js"></script>
<script type="text/javascript" src="js/util/util.js"></script>
<script type="text/javascript" src="js/util/swfobject.js"></script>
<script type="text/javascript" src="js/util/combos.js"></script>
<script type="text/javascript" src="js/util/FileUploadField.js"></script>
<script type="text/javascript" src="js/util/file_form.js"></script>
<script type="text/javascript" src="js/util/persona.js"></script>
<script type="text/javascript" src="js/util/main.js"></script>
<script type="text/javascript" src="js/util/comentarios.js"></script>
<script type="text/javascript" src="js/util/ManduksNotificacion.js"></script>
<script type="text/javascript" src="js/util/login.js"></script>

<!-- CLIENTES-->
<script type="text/javascript" src="js/clientes/clientes.js"></script>
<script type="text/javascript" src="js/clientes/ComboClientes.js"></script>
<script type="text/javascript" src="js/clientes/clientes_form.js"></script>
<script type="text/javascript" src="js/clientes/clientes_grid.js"></script>
<!-- EMBARQUES-->
<script type="text/javascript" src="js/embarques/embarques.js"></script>
<script type="text/javascript" src="js/embarques/WindowFinalizar.js"></script>
<script type="text/javascript" src="js/embarques/embarques_agregar.js"></script>


<!-- ENVIOS-->
<script type="text/javascript" src="js/envios/GridEnvios.js"></script>
<script type="text/javascript" src="js/envios/PanelEnvios.js"></script>
<script type="text/javascript" src="js/envios/envios.js"></script>
<script type="text/javascript" src="js/envios/envios_reportes.js"></script>
<script type="text/javascript" src="js/envios/envios_form.js"></script>
<script type="text/javascript" src="js/envios/envios_tab.js"></script>
<script type="text/javascript" src="js/envios/envios_tab_ups.js"></script>
<script type="text/javascript" src="js/envios/envios_charts.js"></script>

<script type="text/javascript" src="js/envios/transportadora_form.js"></script>
<script type="text/javascript" src="js/envios/formaPago_form.js"></script>

<!-- SUCURSALES-->
<script type="text/javascript" src="js/sucursales/sucursales.js"></script>

<!-- USUARIOS-->
<script type="text/javascript" src="js/usuarios/FormUsuarios.js"></script>
<script type="text/javascript" src="js/usuarios/usuarios.js"></script>



<script type="text/javascript" src="js/GUI/App.js"></script>
<script type="text/javascript" src="js/GUI/Desktop.js"></script>
<script type="text/javascript" src="js/GUI/Module.js"></script>
<script type="text/javascript" src="js/GUI/StartMenu.js"></script>
<script type="text/javascript" src="js/GUI/TaskBar.js"></script>
<script type="text/javascript" src="js/GUI/escritorio.js"></script>

<?php }else{?>
    <script type="text/javascript" src="enlace.js"></script>
<?php }?>

<script type="text/javascript" >



var onloadFunction= function (){
			Ext.form.Field.prototype.msgTarget = 'side';					
			Ext.fly('cargando').remove();
			Ext.fly('cargando-mask').fadeOut({remove:true});

		<?php

				if(!$sesion->logueado()){
		?>										 
					Ext.getBody().update(joshua.HtmlLogin).fadeIn({
							    endOpacity: 1,
							    easing: 'easeOut',
							    duration: .5
							});
					new joshua.Login.Form({
						renderTo:'login-form'		
					});
					//joshua.Reloj.stopAll();
												
		<?php	
				}
				else{
		?>		joshua.InfoUser="<?php echo $sesion->getId().'('.$sesion->sucursal->getNombre().')';?>";
				joshua.login="<?php echo ucfirst( $sesion->getId());?>";
				joshua.foto="img/avatars/<?php echo $sesion->getFoto();?>";
                                joshua.wins="<?php echo $sesion->getWins();?>";
                                joshua.hidden=<?php echo $sesion->getHiddenComponentes();?>;
				joshua.IniciarEscritorio();
		<?php
				}
		?>

}


	Ext.onReady(function (){
		setTimeout(onloadFunction,800);	
	}
	);
</script>

		<body scroll="no">	
<!-- loading mask -->		
						<div id="cargando-mask"></div>
						<div id="cargando">
						  <div class="cargando-indicator">
						   Espere por favor...
						  <br /><span id="cargando-msg">Cargando componentes gr&aacute;ficos...</span>
						  </div>
						</div>

		</body>
</html>
